package java_class_work.week05;

import java.io.File;
import java.io.IOException;

public class FileOperator2 {
    public static void main(String[] args) {
        File file = new File(".\\src\\java_class_work\\iotest\\test.java");
        if(file.exists()) {
            file.delete();
            System.out.println("文件已删除");
        }
        else {
            try {
                file.createNewFile();
                System.out.println("创建新文件");
            } catch (IOException e) {
                e.printStackTrace();
                System.out.println("创建异常");
            }
        }
    }
}
